<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex布局</title>
    <style>
        div {
            display: flex;
            margin: 50px auto;
            background-color: pink;
            width: 80%;
            height: 300px;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
        }
        div span{
            width: 100px;
            height: 100px;
            background-color: purple;
        }
    </style>

</head>

<body>
    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
    </div>
</body>

</html>